From: | Jack York |
Date: | 15 Aug 99 at 01:14:29 |
Subject: | Re: Accessing Broken SCSI |
From: Jack York <jyork@voyager.net>
Hello Ben
On 13-Aug-99, Ben Hutchings wrote:
> From: Ben Hutchings <womble@zzumbouk.demon.co.uk>
>
> On Fri, Aug 13, 1999 at 10:13:11AM -0500, Jack York wrote:
>> From: Jack York <jyork@voyager.net>
>>
>> Hello Ben
>>
>> On 11-Aug-99, Ben Hutchings wrote:
>>> From: Ben Hutchings <womble@zzumbouk.demon.co.uk>
>>>
>>> On Wed, Aug 11, 1999 at 02:10:00PM -0500, Jack York wrote:
>>>> From: Jack York <jyork@voyager.net>
>>>>
>>>> Hello,
>>>>
>>>> I am trying to recover some data from a scsi drive on which the RDB
>>>> is lost. I have never tried doing anything with the SCSI device
>>>> so I may be way off here, but my thought was to take the sample
>>>> code below (from the RKM Scsi_direct example) and change it to a
>>>> a SCSIF_READ command.
>>> <snip>
>>>
>>> Why not use a plain CMD_READ (or TD_READ64 if the drive is bigger
>>> than 4 GB)?
>>
>> As I said I never tried anything with the SCSI device so I am just
>> trying to convert some code to my purposes. CMD_READ may well be
>> easier but without an example it still isn't clear.
>
> See the documentation of trackdisk.device - trackdisk.doc, the RKRM:
> Devices section on it, and example code. SCSI device drivers support
> virtually all trackdisk functionality (there are a few commands that
> are documented as specific to trackdisk.device).
Thanks Ben. I got it to work, sort of. I am trying to recover a number
of files but the most important ones are c source files. So after each
read I did a strstr(buffer, ".c") and if it was found I wrote that to a
file to save. This seemed to work but when I looked at the file, it
didn't have any of the source files I was looking for. It did get quite
a few others though. So I am thinking that I don't have the io_Offset
field set correctly. I am using the example given for a floppy which
multiplies the number of sectors by the number of bytes per sector which,
of cource, is different from the harddisk. So I am guessing that the
reads are only reading partial tracks.
So, for anyone,
How do I get the correct size for each read?
Also, is there a better way to look for the files instead of the strstr
above? It works, but the result is a file with all of the found files
joined together. It would be nice to know where one ends and another
begins instead of manually.
Jack